package ru.neoflex.dataobject.utils;

public class HistoricalProperty {
    private final Object initialValue;
    private Object value;

    public HistoricalProperty(Object value) {
        this.initialValue = value;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public boolean hasChanged() {
        if (initialValue == null && value == null) {
            return false;
        }

        if (initialValue != null && value != null && value.equals(initialValue)) {
            return false;
        }

        return true;
    }
}
